<template>
  <div class="holdSummaryData">
    <!-- 头部搜索部分 -->
    <myHeader @doSearch="doSearch" />
    <!-- 表单主体内容 -->
    <el-card class="box-card">
      <el-row>
        <dynTable
          ref="dynTable"
          :loading="tableLoading"
          :table-data="tableData"
          :table-columns="tableColumns"
          :handle-selection-change="handleSelectionChange"
          :row-click="rowClick"
        />
        <!--分页组件-->
        <pagination
          :total="total"
          :page.sync="listQuery.page"
          :limit.sync="listQuery.size"
          @pagination="getList"
        />
      </el-row>
    </el-card>
  </div>
</template>
<script>
import myHeader from './components/header'
import Pagination from '@/components/Pagination'
import mySetting from '@/mixins/mySetting'
export default {
  name: 'HoldSummaryData',
  components: {
    myHeader,
    Pagination
  },
  mixins: [mySetting],
  data() {
    return {
      tableLoading: true,
      tableColumns: [
        {
          prop: 'WORKORDER',
          label: '工单号'
        },
        {
          prop: 'LOTID',
          label: '测试随工单编号'
        },
        {
          prop: 'EQPID',
          label: '设备编号'
        },
        {
          prop: 'TrStep',
          label: '测试步骤'
        },
        {
          prop: 'StartTime',
          label: '开始时间'
        },
        {
          prop: 'SystemTime',
          label: '保存summary系统时间'
        },
        {
          prop: 'Valid',
          label: '数据是否有效'
        },
        {
          prop: 'TestedQty',
          label: '测试数量'
        },
        {
          prop: 'PassQty',
          label: '良品数量'
        },
        {
          prop: 'RecoverFlag',
          label: '数据保存方式'
        }
      ],
      search: {}
    }
  },
  created() {
    // this.initList();
    this.getMock()
  },
  methods: {
    scopedHandle(val) {
      this.dialogFormVisible = true
      console.log('接收到子组件的值', val)
      this.dialogForm = val
    },
    // 初始化列表
    initList() {
      // let obj = {
      //   ...this.listQuery,
      //   ...this.search
      // }
      // obj = clearNull(obj)
      // Apis.getList(obj).then(res => {
      //   this.tableData = res.data
      //   this.total = res.total
      //   this.options.loading = false
      // })
    },
    // 点击查询
    doSearch(val) {
      // this.search = { ...val };
      // this.search = clearNull(this.search);
      // this.options.loading = true;
      // this.listQuery.page = 1;
      // this.initList();
      this.getMock()
    },
    // 切换分页
    getList(val) {
      this.listQuery = val
      this.initList()
    },
    handleSelectionChange(row) {
      this.multipleSelection = row
    },
    rowClick(row) {
      this.$refs.dynTable.$refs.multipleTable.toggleRowSelection(row)
    }
  }
}
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/defaultStyle.scss";
</style>
